package top.misspro.valheimadminsocket.factory;

import lombok.extern.slf4j.Slf4j;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

/**
 * @author Evan
 */
@Slf4j
public class HandlerStruct {
    private Object object;
    private Method method;

    private HandlerStruct() {
    }

    public HandlerStruct(Object object, Method method) {
        this.object = object;
        this.method = method;
    }

    public Object invoke() throws InvocationTargetException, IllegalAccessException {
        //获取该方法需要得到参数
        return this.method.invoke(this.object);

    }
}
